//
//  ahNNWiJLCFHomeActivityCellWZdeuW.m
//  qcb_ios
//
//  Created by Ji on 2018/8/29.
//  Copyright © 2018年 ski. All rights reserved.
//

#import "ahNNWiJLCFHomeActivityCellWZdeuW.h"

@interface ahNNWiJLCFHomeActivityCellWZdeuW ()

@property (nonatomic, strong) UIImageView *FWzTUPbottomImguGHkAE;

@property (nonatomic, strong) UIImageView *vGAUzptypeImgBvuKut;

@property (nonatomic, strong) UILabel *LufDjKnameLabelRjatWG;

@property (nonatomic, strong) UILabel *hnRcVmtimeLabelncDSPi;

@property (nonatomic, strong) UIImageView *obNvsoshadowImguRAlnk;

@end

@implementation ahNNWiJLCFHomeActivityCellWZdeuW

- (void)reloadData
{
    
    
    if (self.data) {
        
        if (!self.FWzTUPbottomImguGHkAE) {
            self.FWzTUPbottomImguGHkAE = [[UIImageView alloc] initWithFrame:CGRectMake(10, 0, FULL_WIDTH - 20, 250)];
            [self addSubview:self.FWzTUPbottomImguGHkAE];
            
            UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.FWzTUPbottomImguGHkAE.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10,10)];
            //创建 layer
            CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
            maskLayer.frame = self.FWzTUPbottomImguGHkAE.bounds;
            //赋值
            maskLayer.path = maskPath.CGPath;
            self.FWzTUPbottomImguGHkAE.layer.mask = maskLayer;
            
            [self bk_whenTapped:^{
                JLCFBaseWebViewController *vc = [JLCFBaseWebViewController new];
                vc.url = self.data.jumurl;
                [[[JinLiCaiFuApplicationEntrace shareEntrance] currentNavController] pushViewController:vc animated:YES];
            }];
            
        }
        
        if (self.FWzTUPbottomImguGHkAE) {
            [self.FWzTUPbottomImguGHkAE setOnlineImage:self.data.imgurl];
        }
        
        if (!self.vGAUzptypeImgBvuKut) {
            self.vGAUzptypeImgBvuKut = [UIImageView new];
            [self addSubview:self.vGAUzptypeImgBvuKut];
        }
        
        if (self.vGAUzptypeImgBvuKut) {
            self.vGAUzptypeImgBvuKut.image = [UIImage imageNamed:[self.data.status isEqualToString:@"0"] ? @"icon_home_activity_end" : @"icon_home_activity_in"];
            [self.vGAUzptypeImgBvuKut sizeToFit];
            self.vGAUzptypeImgBvuKut.left = self.FWzTUPbottomImguGHkAE.left;
            self.vGAUzptypeImgBvuKut.top = 15;
        }
        
        
        if (!self.LufDjKnameLabelRjatWG) {
            self.LufDjKnameLabelRjatWG = [UILabel new];
            self.LufDjKnameLabelRjatWG.textColor = QTZ_Gray51;
            self.LufDjKnameLabelRjatWG.font = FONT(10);
            [self addSubview:self.LufDjKnameLabelRjatWG];
        }
        
        if (self.LufDjKnameLabelRjatWG) {
            self.LufDjKnameLabelRjatWG.text = self.data.name;
            [self.LufDjKnameLabelRjatWG sizeToFit];
            self.LufDjKnameLabelRjatWG.left = 20;
            self.LufDjKnameLabelRjatWG.centerY = 18 + self.FWzTUPbottomImguGHkAE.bottom;
        }
        
        if (!self.hnRcVmtimeLabelncDSPi) {
            self.hnRcVmtimeLabelncDSPi = [UILabel new];
            self.hnRcVmtimeLabelncDSPi.textColor = QTZ_Gray102;
            self.hnRcVmtimeLabelncDSPi.font = FONT(9);
            [self addSubview:self.hnRcVmtimeLabelncDSPi];
        }
        
        if (self.hnRcVmtimeLabelncDSPi) {
            self.hnRcVmtimeLabelncDSPi.text = [NSString stringWithFormat:@"%@ - %@", [self.data.stime substringToIndex:10], [self.data.etime substringToIndex:10]];
            [self.hnRcVmtimeLabelncDSPi sizeToFit];
            self.hnRcVmtimeLabelncDSPi.right = FULL_WIDTH - 20;
            self.hnRcVmtimeLabelncDSPi.centerY = self.LufDjKnameLabelRjatWG.centerY;
        }
        
        if (!self.obNvsoshadowImguRAlnk) {
            self.obNvsoshadowImguRAlnk = [[UIImageView alloc] initWithFrame:self.FWzTUPbottomImguGHkAE.frame];
            self.obNvsoshadowImguRAlnk.image = [UIImage imageNamed:@"icon_home_activity_shadow"];
            [self addSubview:self.obNvsoshadowImguRAlnk];
        }
        
        if (self.obNvsoshadowImguRAlnk) {
            self.obNvsoshadowImguRAlnk.hidden = ![self.data.status isEqualToString:@"0"];
        }
        
        
    }
    
    
}

@end
